[libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back. Summary: The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy. This patch addresses the issue by correctly using `emplace_back` in C++11 and newer. There are also some bugs in our `insert` implementation, but those will be handled separately. @mclow.lists We should probably merge this into 5.1, agreed? Reviewers: mclow.lists, dlj, EricWF Reviewed By: mclow.lists, EricWF Subscribers: cfe-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D38757 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315994 91177308-0d34-0410-b5e6-96231b3b80d8 
diff --git a/include/deque b/include/deque index f795b48..fee7561 100644 --- a/include/deque +++ b/include/deque 
@@ -1356,7 +1356,6 @@  iterator insert(const_iterator __p, initializer_list<value_type> __il)  {return insert(__p, __il.begin(), __il.end());}  #endif // _LIBCPP_CXX03_LANG -  iterator insert(const_iterator __p, const value_type& __v);  iterator insert(const_iterator __p, size_type __n, const value_type& __v);  template <class _InputIter> @@ -2224,7 +2223,11 @@  !__is_forward_iterator<_InpIter>::value>::type*)  {  for (; __f != __l; ++__f) +#ifdef _LIBCPP_CXX03_LANG  push_back(*__f); +#else + emplace_back(*__f); +#endif  }    template <class _Tp, class _Allocator>